import pymysql
import time
import datetime
class yuanfa():
    def __init__(self):
        self.conn = pymysql.connect(host='10.145.128.242', port=3306, user='master', passwd='oQYfTa&&83752661lnFLsUMNTsVgvf', db='master')
        self.cursor = self.conn.cursor()
    def shujuzengliang(self, enterprise):
#        conn = pymysql.connect(host='10.145.128.242', port=3306, user='master', passwd='oQYfTa&&83752661lnFLsUMNTsVgvf', db='master')
        suoshuqiye=yonghuqiye[enterprise]
        today = datetime.date.today()
        oneday = datetime.timedelta(days=1)
        yesterday = today - oneday
        yesterday = str(yesterday)
        sql = """
        SELECT
             count( 1 )
        FROM
             (
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zhengshudaoqitixingr WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zhengshuchuli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zizhirenzheng WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shehuiguanxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jiatingchengyuan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_hetongguanli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jixiaobiaoxian WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jianzhijingli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gongzuojingli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jiaoyupeixunjingli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_wodejianli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gangweiguanli1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gangweizeren WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gangweirenyuan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinshengfangxiang WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_bibeijineng WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_wodegongzuohuanjing WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_anquanzeren WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_renzhiyaoqiu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_xuexikecheng WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyexinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyexinxiguanli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_bumenxinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_neishejigouguanli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_rencaiku WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_hetongguanlixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jixiaoxinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shehuiguanxixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jiatingchengyuanxinx WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jiaoyupeixunjinglixi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zizhixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jianzhijinglixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gongzuojinglixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_anquanzerenxinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_wodegangwei WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_wodezhizeshiming WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gangweibibeijineng WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_wodeweilai WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gongzuohuanjing WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gangweixuexikecheng WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_renzhiyaoqiuxinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinengdianliang WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinengdianlian1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinengxuexi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinengzhangwoshulian WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinengzhangwo WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_kaoshitaizhangbiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shitujieduishenqing WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shitudaijiaomubiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shitudaijiaomubiaogu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shitujieduixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zhongzhishenqing WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunfankui WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shitujieduixiaojie WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jieduanhuibaoxinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunzongping WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_daijiaomubiaopingjia WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_lungangshenqing WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_mubiaojihua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_lungangguanli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_lungangmubiaojihua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gongzuojiaojieshenqi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_gongzuojiaojie WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jiaojiequeren WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yueduhuibao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_huibaoneirong WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_lungangzongjie WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_faqilungangpingjia WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_mubiaojihuapingfenfu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_lungangpingfen WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_lungangqitaxiangping WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shifuxingweibiaoxian WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jifencaozuo WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yuangongpaixinganniu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jifenduanweibiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jifenheji WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jifentaizhang WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yewuguizeduizhaobiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jifenpaixinglishijil WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyeyuzuzhijiagougua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_waibulianjiedizhi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_wailianmokuaimingche WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jinqidongtai WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_changjingsancaidan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_changjingyicaidan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_changjingercaidan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_changjingliucaidan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_changjingwucaidan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_changjingsicaidan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caidantupianmoban WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caidanxin WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caida1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caidantaizhang WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caidandingshiqi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caidanchangjingmiaos WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyemingchengzidianb WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_huati WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_quanzi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_dianzan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_pinglun WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shoucang WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jishubiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_huatishenhe WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyeguanliyuan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_fujianceshibiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zahuopufujianbiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_quanxiankongzhibiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyehehuatishenheyua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunpingjiasixinxi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunshishisixin WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindesixinxia1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindesixinyua1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunpingjiasixinyu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunshishiyuangong WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunshishixiangmu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_sixinpeixun WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunqiandaobiaosix WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunpingjiasixin WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindesixin WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zhuangangligangpeix1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zhuangangligangpeix2 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_zhuangangligangpeixu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_pingjianeirongsixinx WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindesixinxian WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_pingjianeirongsixiny WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindesixinyuan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qiyepeixunjihua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxuqiushouji WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunjihuagongbunei WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindeyuangong WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxindexiangmu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunqiandaobiaoyua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunqiandaobiaoxia WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunneirongxuanze WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunneirongguanli WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunneirongqita WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_sixinpeixunyuangong WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_sixinpeixunxiangmu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_xinyuangongrusipeix2 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_xinyuangongrusipeix1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_xinyuangongrusipeixu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunshishi WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunjihuagongbu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunqiandaobiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunleibie WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunjihuabiangeng WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxinde WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunneirongbixiu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shishineirong WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shishineirongyuangon WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_shishineirongxiangmu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yuangongpeixunjihua WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunneirongxuanxiu WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jihuawaipeixunxuqius WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_qita5 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunpingjiapingdi1 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunpingjiapingdi2 WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_bumenjinglihuiqian WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_kechengbiaoqian WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunpingjiapingdin WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yuangongpeixundangan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_peixunxiangmudangan WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yansebiao WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_morenkuaijieyingyong WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_yuanfakuaijieyingyon WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_huati WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_pinglun WHERE DISABLE != 1
        	UNION ALL
        	SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_jifentaizhang WHERE DISABLE != 1
	        UNION ALL
	        SELECT `owner`,DATE_FORMAT(`created_at`,'%Y-%m-%d') as created_at FROM ent_wuliushiyebu_datapool_caidantaizhang WHERE DISABLE != 1  
        	 ) AS t1
        WHERE
             t1.OWNER IN (
             SELECT
                  user_id
             FROM
                  ent_wuliushiyebu_appoint
             WHERE
             role_type = 1
             AND role_name LIKE 'suoshuqiye-%')
        	 and
        	 t1.created_at = 'zengliangriqi'
        """
        sql = sql.replace("suoshuqiye", str(suoshuqiye))
        sql = sql.replace('zengliangriqi', yesterday)
        print(sql)
        self.cursor.execute(sql)
        self.conn.commit()
        row_1 = self.cursor.fetchone()
        print(row_1)
        self.cursor.close()
        self.conn.close()
if __name__ == '__main__':
    yonghuqiye = {'zhonghuanantonggang': '中化南通', 'zhonghuayangzhou': '中化扬州', 'zhonghuatianjin': '天津仓储',
                 'zhonghuadongfang': '中化东方', 'zhonghuazhuhai': '中化珠海', 'zhoushanguochu': '舟山国储',
                 'zhonghuaxinghai': '中化兴海', 'yingjijidi': '应急基地', 'zhonghuazhoushan': '中化兴中' }
    suoshuqiye=""
    a = yuanfa()
    a.shujuzengliang("zhonghuanantonggang")
